export const getPageTitle = (pageNo) => {
  const pageData = [
    { name: "mHome", pageNo: "1001", title: "首页" },
    { name: "mSendNotice", pageNo: "1002", title: "发送消息" },
    { name: "mSendNotice", pageNo: "1003", title: "个人中心" },
    { name: "mSendNotice", pageNo: "1004", title: "详情页面" },
    { name: "mAllSendNotice", pageNo: "1005", title: "所有通知" },
  ];
  for (let index in pageData) {
    if (pageNo === pageData[index].pageNo) {
      return pageData[index].title;
    }
  }
};

export const getPageNo = (url) => {
  if(url.indexOf("?") !== -1){
    return url.substring(url.lastIndexOf("/"),url.lastIndexOf("?"));
  }
  return url.substring(url.lastIndexOf("/") + 1);
};
